/**
 * picker组件和箭头函数（箭头函数是ES6引进去的）
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Picker,
    ViewPagerAndroid,
} from 'react-native';
import BaseComponent from './BaseComponent';

class MyPicker extends BaseComponent {

    // 构造
      constructor(props) {
        super(props);
        // 初始状态
        this.state = {
            lanage:null,
        };
      }

    render() {
        return (
            <View style={styles.flex}>
                <Picker  selectedValue={this.state.lanage}
                        onValueChange={lang => this.setState({lanage: lang})}
                        mode="dialog"
                        style={{color:'#f00'}}
                >
                    <Picker.Item label="Java" value="java" />
                    <Picker.Item label="android" value="android" />
                    <Picker.Item label="ios" value="ios" />
                    <Picker.Item label="html5" value="html5" />
                    <Picker.Item label="vue" value="vue" />
                    <Picker.Item label="php" value="php" />
                </Picker>
                <Text>
                    {this.state.lanage}
                </Text>
            </View>

        );
    }
}

const styles = StyleSheet.create({
    mypicker:{

    },
    flex:{
        flex:1,
    },
    fount:{
        fontSize:24,
        color:'#ff0000',
        fontWeight:'bold',
        textAlign:'center',
    },


});
module.exports=MyPicker;